function onMapsClick(param)
{
    // 点击取消选中
    if (!geoName) {
        return;
    }
}
function getCompetitors(){
     //点击取消选中
    if (!geoName && geoChain.length == 1) {
        // 全国未选中状态，返回
        alert('未选中地区');
        return;
    }

    // 参数
    jQuery.ajaxSettings.async = false;
    var params = [];
    var geoLevel = getGeoLevel(geoName);
    params.push('parameters[national_id]=' + getNationalID(geoLevel, geoName));
    params.push('parameters[geo_level]=' + geoLevel);
    params.push('parameters[year]=' + jQuery("select[name='year']").val());
    params.push('parameters[month]=' + jQuery("select[name='month']").val());
    params.push('parameters[geo_name]=' + (!geoName ? geoChain[geoChain.length-1] : geoName));
    params.push('parameters[fertilizer]=' + jQuery("select[name='fertilizer']").val())

    jQuery.getJSON(nonghuaBaseUrl + '/api/competitors?' + params.join('&'), function (json) {
        optionQoQ_competitors.legend.data = json.legend;
        optionQoQ_competitors.xAxis[0].data = json.xAxis;
        optionQoQ_competitors.series = json.yAxis;

        competitors.setOption(optionQoQ_competitors, true);
        jQuery('#myModal').modal('show');

    });     
}
/*******************************图表相关************************************/
var optionQoQ_competitors = {
    title : {
        text: '',
    },
    tooltip : {
        trigger: 'axis',
        formatter: function (params,ticket,callback) {
            console.log(params)
            var res = params[0].name;
            for (var i = 0, l = params.length; i < l; i++) {
                res += '<br/>' + params[i].seriesName + ' : ' + params[i].value;
            }
            setTimeout(function (){
                // 仅为了模拟异步回调
                callback(ticket, res);
            }, 200)
            return 'loading';
        }
    },
    legend: {
        data:[]
    },
    calculable : false,
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            categories : []
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : []
};

var competitors = echarts.init(document.getElementById('divcompetitors'));

jQuery(function($) {
    initMap("#map_previous", "#map_next");
});